package mil.af.amc.adpetracker.dao.hibernate;

import mil.af.amc.adpetracker.dao.ItemConditionDao;
import mil.af.amc.adpetracker.model.ItemCondition;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * Please Fill in this Javadoc
 *
 * @author TSgt Jason Ferguson
 */
@Service("itemConditionDao")
public class HibernateItemConditionDao extends HibernateGenericDao<ItemCondition> implements ItemConditionDao {

    Log log = LogFactory.getLog(HibernateItemConditionDao.class);

    public HibernateItemConditionDao() {
        super(ItemCondition.class);
    }

    @SuppressWarnings("unchecked")
    public List<ItemCondition> getList() {

        List<ItemCondition> results = new ArrayList<ItemCondition>();
        try {
            results = getHibernateTemplate().find("from ItemCondition");
        } catch (DataAccessException e) {
            log.debug(e);
            e.printStackTrace();
        }

        return results;
    }
}
